From 662eb5d638e48f43b8bf168ffb702fcde8a714ee Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 23 Jan 2005 04:19:50 +0000 Subject: [PATCH] util.c: add case_ignore_strncmp --- gpsbabel/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 69f0d9370..165453a3e 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -326,6 +326,20 @@ case_ignore_strcmp(const char *s1, const char *s2) } +int +case_ignore_strncmp(const char *s1, const char *s2, int n) +{ + int rv = 0; + + while (n && ((rv = toupper(*s1) - toupper(*s2)) == 0) + && *s1) { + s1++; + s2++; + n--; + } + return rv; +} + void printposn(const double c, int is_lat) { -- 2.30.2